<html>
    <head>
    <script language="JavaScript">
    <!--
    function submitForm(){
      if(document.myForm.myText.value == ""){
        alert("Please enter some text first");
      }else{
        document.myForm.mySubmit.click();
      }
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
    Please Enter some text and click the link.<br>
      <input type=TEXT value="" name="myText">
      <input type=SUBMIT value="Submit" name="mySubmit">
    </form>
    <br>
    <a href="javascript:submitForm()">Click here to submit the form</a>
    </body>
    </html>